package com.swpu.service_knowledge.controller;


import com.swpu.commonutils.R;
import com.swpu.service_knowledge.entity.KnowledgeCategory;
import com.swpu.service_knowledge.service.KnowledgeCategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author chaichai
 * @since 2024-03-27
 */
@RestController
@RequestMapping("/service_knowledge/knowledge-category")
public class KnowledgeCategoryController {
    @Autowired
    private KnowledgeCategoryService knowledgeCategoryService;

    @GetMapping("getCategoryList")
    public R getCategoryList(){
        List<KnowledgeCategory> categoryList = knowledgeCategoryService.getCategoryList();
        return  R.ok().data("categoryList",categoryList);
    }
}

